package com.lhn.controller;

import com.lhn.entity.Admin;
import com.lhn.entity.User;
import com.lhn.service.AdminService;
import com.lhn.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lhn
 * @date 2024-10-13 13:06
 */

@RestController
@RequestMapping("account")
public class AccountController {

    @Autowired
    private AdminService adminService;

    @Autowired
    private UserService userService;

    @PostMapping("login/user")
    public User login(@RequestBody User user) {
        return userService.login(user);
    }

    @PostMapping("login/admin")
    public Admin login(@RequestBody Admin admin) {
        return adminService.login(admin);
    }
}
